home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1999 November / SOTMC_Nov1999-Ultimate.iso / mac / REALbasic ƒ / Examples / Techniques / Examples by Thomas Tempelmann / TT's HideMenubar-Plugin / Source Code (CW Pro 3) / Some Libs & Stubs / 68K Interface.c next >
Encoding:
C/C++ Source or Header  |  1999-03-10  |  1.1 KB  |  50 lines  |  [TEXT/CWIE]

  1. /*
  2.  * 68K Interface.c
  3.  *
  4.  * Provide access for PPC code to some 68K traps that are not available in a PPC Lib
  5.  */
  6.  
  7. #include <MixedMode.h>
  8. #include <Resources.h>
  9. #include "68K Interface.h"
  10.  
  11. enum {
  12.     par1 = kD0DispatchedPascalStackBased
  13.          | RESULT_SIZE (SIZE_CODE (sizeof (Boolean)))
  14.          | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE (SIZE_CODE (sizeof(short))),
  15.  
  16.     par2 = kD0DispatchedPascalStackBased
  17.          | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE (SIZE_CODE (sizeof(short)))
  18.          | STACK_ROUTINE_PARAMETER (2, SIZE_CODE (SIZE_CODE (sizeof(Boolean)))),
  19.  
  20. };
  21.  
  22. static far UniversalProcPtr theTrap;
  23. static far Boolean inited = false;
  24.  
  25. void Init68KInterface ();
  26.  
  27.  
  28. EXTERN_API (Boolean) SBIsControlStripVisible (void)
  29. // moveq #0,d0; dc.w 0xAAF2
  30. {
  31.     if (!inited) Init68KInterface ();
  32.     return CallUniversalProc (theTrap, par1, (short)0x0000);
  33. }
  34.  
  35. EXTERN_API (void) SBShowHideControlStrip (Boolean showIt)
  36. // move #$0101,d0; dc.w 0xAAF2
  37. {
  38.     if (!inited) Init68KInterface ();
  39.     CallUniversalProc (theTrap, par2, (short)0x0101, (Boolean)showIt);
  40. }
  41.  
  42.  
  43. void Init68KInterface ()
  44. {
  45.     theTrap = GetToolTrapAddress (0xAAF2);
  46.     inited = true;
  47. }
  48.  
  49. // EOF
  50.